import 'package:get/get.dart';
import 'app_database.dart';

class DatabaseManager extends GetxService {
  static DatabaseManager get to => Get.find();
  
  late AppDatabase _database;
  
  Future<DatabaseManager> init() async {
    _database = await AppDatabase.init();
    return this;
  }
  
  AppDatabase get database => _database;
  
  Future<void> closeDatabase() async {
    await _database.close();
  }
}